﻿using System;

namespace IoC4Fun
{
    /// <summary>
    /// Properties Condition: Search = Means Search Implementation and Inject, DisposeAll = Don't take any property to inject implementation, AllowNull = Allow some properties to be null without throw an Exception
    /// </summary>
    public enum PropertiesTypeCondition { Search, DisposeAll, AllowNull }
    /// <summary>
    /// InstanceTypeCondition: Share the same instance registered or create a new instance instead (NonShare Option)
    /// </summary>
    public enum InstanceTypeCondition { NonShare, Share}

    public class TypeRegister
    {
        /// <summary>
        /// Key = Represent a Contract or Type of Interface 
        /// </summary>
        public Type Key { get; set; }
        /// <summary>
        /// Implementation = Type of Concrete Class
        /// </summary>
        public Type Implementation { get; set; }
        /// <summary>
        /// Name of the property that will be injected
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// Instance already created in memory of the implementation 
        /// </summary>
        public object Instance { get; set; }
        /// <summary>
        /// Properties Condition: Search = Means Search Implementation and Inject, DisposeAll = Don't take any property to inject implementation, AllowNull = Allow some properties to be null without throw an Exception
        /// </summary>
        public PropertiesTypeCondition PropertiesCondition { get; set; }
        /// <summary>
        /// InstanceTypeCondition: Share the same instance registered or create a new instance instead (NonShare Option)
        /// </summary>
        public InstanceTypeCondition InstanceCondition { get; set; }
    }
}
